import request from '@/utils/request'

// 查询表信息列表
export function listTable(query) {
  return request({
    url: '/reportworld/table/list',
    method: 'get',
    params: query
  })
}

// 查询表信息详细
export function getTable(data) {
  return request({
    url: '/reportworld/table/getTable',
    method: 'post',
    data: data
  })
}

// 新增表信息
export function addTable(data) {
  return request({
    url: '/reportworld/table',
    method: 'post',
    data: data
  })
}

// 修改表信息
export function updateTable(data) {
  return request({
    url: '/reportworld/table',
    method: 'put',
    data: data
  })
}

// 删除表信息
export function delTable(idList, hisVersion) {
  const data = {
    idList,
    hisVersion
  };
  return request({
    url: '/reportworld/table/remove',
    method: 'post',
    data: data
  })
}

// 初始化查询
export function init(data) {
  return request({
    url: '/reportworld/table/init',
    method: 'post',
    data: data
  })
}


// 批量修改表信息
export function handleUpdateBatch(data) {
  return request({
    url: '/reportworld/table/handleUpdateBatch',
    method: 'post',
    data: data
  })
}

//导出建表语句
export function tableCreateInfo(queryJson) {
  return request({
    url: '/reportworld/table/tableCreateInfo',
    method: 'post',
    data: queryJson
  })
}

// 获取一张表信息到库里
export function readTableInfo(data) {
  return request({
    url: '/reportworld/table/readTableInfo/',
    method: 'post',
    data: data
  })
}
